<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>监听对象中属性的变化</title>
		<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css" />
		<script src="js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/Underscore-1.8.3.js"></script>
		<script src="js/backbone.js"></script>
		<script type="text/javascript">
		</script>
	</head>
	<body> 
		<script type="text/javascript">
			 var Person=Backbone.Model.extend({
			 	initialize:function(){
			 		this.bind("change:name",function(){
			 			var name=this.get('name'); 
			 			alert("你变了name属性为："+name);
			 		})
			 	},
			 	defaults:{
			 		name:"潘胜男",
			 		age:'5'
			 	},
			 	aboutMe:function(){
			 		return "我叫"+this.get("name")+"今年"+this.get("age")+"岁";
			 	}
			 });
			var pan=new Person; 
			pan.set({name:'jeack'});
			alert(pan.aboutMe());
		</script>
	</body>
</html>